﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nature.Toolkit.GKin
{
    public class UVEulerImplicitTPYSolver : EulerImplicitTPYSolver
    {
        private double m_u, m_ro;

        public UVEulerImplicitTPYSolver(ModelObject model) : base(model) { }

        protected override void ComputeTP(ReadOnlyIdealGasMixture variable, TPYVector function)
        {
            function.T = variable.SpecificU - m_u;
            function.P = variable.MassDensity - m_ro;
        }

        public override void Reset(IdealGasMixture mixture)
        {
            base.Reset(mixture);
            m_ro = mixture.MassDensity;
            m_u = mixture.SpecificU;
        }
    }
}
